// package com.xiaoluyy.order.client;
//
//
//
// import java.util.ArrayList;
// import java.util.List;
// import java.util.Map;
// import javax.annotation.PostConstruct;
//
// import com.sun.org.slf4j.internal.Logger;
// import com.sun.org.slf4j.internal.LoggerFactory;
// import org.springframework.beans.factory.annotation.Autowired;
// import org.springframework.beans.factory.annotation.Value;
//
// import org.springframework.stereotype.Component;
//
// @Component
// public class RpcClient{
//     private Logger logger = LoggerFactory.getLogger(this.getClass());
//     private List<String> independents = new ArrayList();
//     private String application;
//
//     public RpcClient() {
//     }
//
//     @PostConstruct
//     public void initInvoker() {
//
//     }
//
//     /** @deprecated */
//     @Deprecated
//     public <T> List<T> postForList(Class<T> clazz, String systemCode, String serviceName, String serviceMethod, RpcParam param) {
//         this.check();
//         return (List)this.rpcInvokerForPhp.execute(clazz, this.independents.contains(systemCode.toLowerCase()) ? systemCode : this.application, systemCode, serviceName, serviceMethod, param, 1);
//     }
//
//     /** @deprecated */
//     @Deprecated
//     public <T> T postForObject(Class<T> clazz, String systemCode, String serviceName, String serviceMethod, RpcParam param) {
//         this.check();
//         return this.rpcInvokerForPhp.execute(clazz, this.independents.contains(systemCode.toLowerCase()) ? systemCode : this.application, systemCode, serviceName, serviceMethod, param, 2);
//     }
//
//     /** @deprecated */
//     @Deprecated
//     public <T> RpcPagingResult<T> postForRpcPagingResult(Class<T> clazz, String systemCode, String serviceName, String serviceMethod, RpcParam param) {
//         this.check();
//         return (RpcPagingResult)this.rpcInvokerForPhp.execute(clazz, this.independents.contains(systemCode.toLowerCase()) ? systemCode : this.application, systemCode, serviceName, serviceMethod, param, 3);
//     }
//
//     public <T> RpcResponse<List<T>> postForPhpList(Class<T> clazz, String systemCode, String serviceName, String serviceMethod, RpcParam param) {
//         this.check();
//         return this.rpcInvokerForPhp.execute2(clazz, this.independents.contains(systemCode.toLowerCase()) ? systemCode : this.application, systemCode, serviceName, serviceMethod, param, 1);
//     }
//
//     public <T> RpcResponse<T> postForPhpObject(Class<T> clazz, String systemCode, String serviceName, String serviceMethod, RpcParam param) {
//         this.check();
//         return this.rpcInvokerForPhp.execute2(clazz, this.independents.contains(systemCode.toLowerCase()) ? systemCode : this.application, systemCode, serviceName, serviceMethod, param, 2);
//     }
//
//     public <T> RpcResponse<RpcPagingResult<T>> postForPhpPagingResult(Class<T> clazz, String systemCode, String serviceName, String serviceMethod, RpcParam param) {
//         this.check();
//         return this.rpcInvokerForPhp.execute2(clazz, this.independents.contains(systemCode.toLowerCase()) ? systemCode : this.application, systemCode, serviceName, serviceMethod, param, 3);
//     }
//
//     public <T> RpcResponse<T> restInvokeForObject(Class<T> clazz, String systemCode, String url, HttpRpcMethod rpcMethod, RpcParam param) {
//         this.check();
//         return this.rpcInvokerForJava.executeForObject(clazz, systemCode, url, param, HttpMethod.valueOf(rpcMethod.name()), (Object)null, (Map)null);
//     }
//
//     public <T> RpcResponse<List<T>> restInvokeForList(Class<T> clazz, String systemCode, String url, HttpRpcMethod rpcMethod, RpcParam param) {
//         this.check();
//         return this.rpcInvokerForJava.executeForList(clazz, systemCode, url, param, HttpMethod.valueOf(rpcMethod.name()), (Object)null, (Map)null);
//     }
//
//     public <T, B> RpcResponse<T> restInvokeForObject(Class<T> clazz, String systemCode, String url, HttpRpcMethod rpcMethod, RpcParam param, B requestBody) {
//         this.check();
//         return this.rpcInvokerForJava.executeForObject(clazz, systemCode, url, param, HttpMethod.valueOf(rpcMethod.name()), requestBody, (Map)null);
//     }
//
//     public <T, B> RpcResponse<List<T>> restInvokeForList(Class<T> clazz, String systemCode, String url, HttpRpcMethod rpcMethod, RpcParam param, B requestBody) {
//         this.check();
//         return this.rpcInvokerForJava.executeForList(clazz, systemCode, url, param, HttpMethod.valueOf(rpcMethod.name()), requestBody, (Map)null);
//     }
//
//     public <T, B> RpcResponse<T> restInvokeForObject(Class<T> clazz, String systemCode, String url, HttpRpcMethod rpcMethod, RpcParam param, B requestBody, Map<String, String> optionalHeader) {
//         this.check();
//         return this.rpcInvokerForJava.executeForObject(clazz, systemCode, url, param, HttpMethod.valueOf(rpcMethod.name()), requestBody, optionalHeader);
//     }
//
//     public <T, B> RpcResponse<List<T>> restInvokeForList(Class<T> clazz, String systemCode, String url, HttpRpcMethod rpcMethod, RpcParam param, B requestBody, Map<String, String> optionalHeader) {
//         this.check();
//         return this.rpcInvokerForJava.executeForList(clazz, systemCode, url, param, HttpMethod.valueOf(rpcMethod.name()), requestBody, optionalHeader);
//     }
//
//     private void check() {
//         if (RpcPrecondition.refuse()) {
//             throw new Error("RPC invoke in a transaction");
//         }
//     }
//
//     public static enum HttpRpcMethod {
//         GET,
//         POST,
//         DELETE,
//         PUT;
//
//         private HttpRpcMethod() {
//         }
//     }
// }
//
